package system1

import (
	v1 "github.com/flipped-aurora/gin-vue-admin/server/api/v1"
	"github.com/flipped-aurora/gin-vue-admin/server/middleware"
	"github.com/gin-gonic/gin"
)

type WorkflowDefRouter struct {
}

// InitWorkflowDefRouter 初始化 审批流 路由信息
func (s *WorkflowDefRouter) InitWorkflowDefRouter(Router *gin.RouterGroup) {
	WorkflowRouter := Router.Group("WorkflowDef").Use(middleware.OperationRecord())
	WorkflowRouterWithoutRecord := Router.Group("WorkflowDef")
	var WorkflowDefApi = v1.ApiGroupApp.System1ApiGroup.WorkflowDefApi
	{
		WorkflowRouter.POST("createWorkflowDef", WorkflowDefApi.CreateWorkflowDef)               // 新建审批流
		WorkflowRouter.POST("updateWorkflowDefByChart", WorkflowDefApi.UpdateWorkflowDefByChart) // 通过图形用id修改审批流Def
		WorkflowRouter.DELETE("deleteWorkflowDef", WorkflowDefApi.DeleteWorkflowDef)             // 删除审批流
		WorkflowRouter.DELETE("deleteWorkflowDefByIds", WorkflowDefApi.DeleteWorkflowDefByIds)   // 批量删除审批流
		WorkflowRouter.PUT("updateWorkflowDef", WorkflowDefApi.UpdateWorkflowDef)                // 更新审批流
	}
	{
		WorkflowRouterWithoutRecord.GET("getWorkflowDef", WorkflowDefApi.GetWorkflowDef)         // 根据ID获取审批流
		WorkflowRouterWithoutRecord.GET("findWorkflowDef", WorkflowDefApi.FindWorkflowDef)       // 根据ID获取审批流
		WorkflowRouterWithoutRecord.GET("getWorkflowDefList", WorkflowDefApi.GetWorkflowDefList) // 获取审批流列表

	}
}
